package com.xunfang.mapper;

import com.xunfang.bean.Order;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

/**
 * @author yellow Docter
 * @date 2023 -11-20
 * @desc
 */
public interface OrderMapper {

    @Select("select * from t_order")
    List<Order> findOrders();

    // 如果sql中:  t_order 不加字段   添加全部
    // 如果sql中:  t_order 加字段    添加指定字段的数据
    @Insert("insert into t_order(order_name,order_price) values(#{orderName},#{orderPrice})")
    int  addOrders(Order order);

    @Delete("delete from t_order where order_id = #{id}")
    int deleteOrderById(int id);

}
